<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-nested" prefix="nested" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ page contentType="text/html; charset=utf-8"  import="com.leexuan.ordersystem.beans.*" import="com.leexuan.ordersystem.*"  import="java.util.*"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">

<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<LINK href="css/admincp.css" type=text/css rel=stylesheet>
</HEAD>

<BODY topMargin=10>
<TABLE cellSpacing=6 cellPadding=2 width="100%" border=0>
  <TBODY>
  <TR>
    <TD>
      <TABLE class=guide cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR>
          <TD>到帐管理&nbsp;>>&nbsp;增加到帐</TD></TR></TBODY></TABLE><BR>
      <TABLE class=tableborder cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR class=header>
          <TD colSpan=2>发票明细</TD></TR>
          
<%

Order od = (Order)session.getAttribute("order");
Invoice in = (Invoice)session.getAttribute("invoice");


%>          
        <TR>
          <TD class=altbg1 width="20%">订单编号：</TD>
          <TD class=altbg2 align=right>#<%=in.getOid()%></TD></TR>

        <TR>
          <TD class=altbg1>客户名称：</TD>
          <TD class=altbg2 align=right width="50%">
          <%=in.getName()%>
          </TD>

          </TR>
        <TR>
          <TD class=altbg1>客户开户银行：</TD>
          <TD class=altbg2 align=right>
          <%=in.getBank()%></TD>
          </TR>
        <TR>
          <TD class=altbg1>客户银行帐号：</TD>
          <TD class=altbg2 align=right>
          <%=in.getAccount()%></TD>
          </TR>

        <TR>
          <TD class=altbg1 width="30%">开票日期：</TD>
          <TD class=altbg2 align=right>
		<%=in.getDate()%>
</TD></TR>
            
        <TR>
          <TD class=altbg1>发票金额：</TD>
          <TD class=altbg2 align=right><%=in.getTotal()%> 元</TD></TR>

        <TR>
          <TD class=altbg1>到帐金额：</TD>
          <TD class=altbg2 align=right><%=in.getTotal()-in.getRemain()%> 元</TD></TR>
          
        <TR>
          <TD class=altbg1>欠款金额：</TD>
          <TD class=altbg2 align=right>
          <%if (in.getRemain()==0){
          	out.println("<font color=red>全部到帐</font>");
          
          }else{
        	  out.println(in.getRemain()+" 元");
          }%>
          
</TD></TR>    
      
    	</TD></TR></TBODY></TABLE>
    	
          <%if (in.getRemain()!=0){

          %>
<br>
      <TABLE class=tableborder cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR class=header>
          <TD colSpan=2>新增到帐</TD></TR>
        <TR>
          <TD class=altbg1>到帐日期：</TD>
          <TD class=altbg2 align=right>
<script type="text/javascript">

var myDate = new Date(); 

document.write( myDate.getFullYear()+"-"+(myDate.getMonth()+1)+"-"+myDate.getDate());

</script>           
          </TD></TR>  

<html:form action="/addMoney2.do" method="post">
        <TR>
          <TD class=altbg1>新增到帐金额：</TD>
          <TD class=altbg2 align=right><input type="text" name="account" size=10 value=<%=in.getRemain()%>> 元</TD></TR>    

		<input type="hidden" name="iid" value="<%=in.getIid()%>">
		<input type="hidden" name="oid" value="<%=in.getOid()%>">
		<html:errors/>
    </TBODY></TABLE><BR>      

<CENTER><INPUT class=button type=submit value="增加到帐"></CENTER>
</html:form>

           <%}

          %>

<%
session.removeAttribute("order");

session.removeAttribute("invoice");
%>
      
  

<%@include file= "./footer.jsp"%>
